package com.jd.finance.oss.service;

import com.jd.finance.oss.model.OssObject;
import com.jd.finance.oss.exception.OSSException;
import com.jd.finance.oss.model.User;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

public interface FileService {


    void removeFile(String url);

    /**
     * 文件上传至阿里云
     *
     * @param file      上传的对象
     * @param module    业务类型
     * @param userInfoS 上传的用户
     * @return
     */
    List<OssObject> upload(MultipartFile[] file, String module, User userInfoS) throws OSSException;

    /**
     * 下载单个对象
     *
     * @param objectId 对象标识
     * @param req      http请求
     * @param res      http响应
     */
    void downloadObject(Long objectId, HttpServletRequest req, HttpServletResponse res) throws OSSException;
}
